<template>
  <div>
    <CloudSwitch :default-checked="false" @change="changeMode" /> Change Mode
    <span className="ant-divider" style="margin: 0 1em" />
    <CloudSwitch :default-checked="false" @change="changeTheme" /> Change Theme
    <br />
    <br />
    <CloudMenu
      style="width: 256px"
      :default-selected-keys="['1']"
      :default-open-keys="['sub1']"
      :mode="mode"
      :theme="theme"
    >
      <CloudMenuItem key="1">
        <CloudIcon type="mail" />
        Navigation One
      </CloudMenuItem>
      <CloudMenuItem key="2">
        <CloudIcon type="calendar" />
        Navigation Two
      </CloudMenuItem>
      <CloudSubMenu key="sub1">
        <span slot="title"><CloudIcon type="appstore" /><span>Navigation Three</span></span>
        <CloudMenuItem key="3">
          Option 3
        </CloudMenuItem>
        <CloudMenuItem key="4">
          Option 4
        </CloudMenuItem>
        <CloudSubMenu key="sub1-2" title="Submenu">
          <CloudMenuItem key="5">
            Option 5
          </CloudMenuItem>
          <CloudMenuItem key="6">
            Option 6
          </CloudMenuItem>
        </CloudSubMenu>
      </CloudSubMenu>
      <CloudSubMenu key="sub2">
        <span slot="title"><CloudIcon type="setting" /><span>Navigation Four</span></span>
        <CloudMenuItem key="7">
          Option 7
        </CloudMenuItem>
        <CloudMenuItem key="8">
          Option 8
        </CloudMenuItem>
        <CloudMenuItem key="9">
          Option 9
        </CloudMenuItem>
        <CloudMenuItem key="10">
          Option 10
        </CloudMenuItem>
      </CloudSubMenu>
    </CloudMenu>
  </div>
</template>
<script>
export default {
  title: '7.切换菜单类型',
  data() {
    return {
      mode: 'inline',
      theme: 'light',
    };
  },
  methods: {
    changeMode(checked) {
      this.mode = checked ? 'vertical' : 'inline';
    },
    changeTheme(checked) {
      this.theme = checked ? 'dark' : 'light';
    },
  },
};
</script>